home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
SGI Developer Toolbox 6.1
/
SGI Developer Toolbox 6.1 - Disc 4.iso
/
src
/
swtools
/
trubasic
/
rolldemos
/
chooser
/
intmenu.tru
< prev
next >
Wrap
Text File
|
1994-08-02
|
2KB
|
70 lines
external
! main menu loop for interactiv demos
module int
DECLARE PUBLIC intpts(,),inttxt$()
sub int_demos
call draw_int
call waitup
do
call getclick_int(op)
if op=1 then
chain "!cd ../demos/interact;../../basic/tru -i tbmap.tru &",return
elseif op=2 then
chain "!cd ../demos/interact;../../basic/tru -i tbedit.tru &",return
elseif op=3 then
chain "!cd ../demos/interact;../../basic/tru -i record.tru &",return
elseif op=4 then
chain "!cd ../demos/interact;../../basic/tru -i house3.tru &",return
elseif op=5 then
chain "!cd ../demos/interact;../../basic/tru -i aboutact.tru &",return
elseif op=6 then
chain "!cd ../demos/interact;../../basic/tru -i zplot3.tru &",return
elseif op=0 then
exit sub
end if
if op<>0 and op<>-1 then
call expand(intpts(op,1),intpts(op,2),intpts(op,3),intpts(op,4))
draw textbox(intpts(op,1),intpts(op,2),intpts(op,3),intpts(op,4),inttxt$(op))
call waitup
pause 3
call unexpand(intpts(op,1),intpts(op,2),intpts(op,3),intpts(op,4))
draw textbox(intpts(op,1),intpts(op,2),intpts(op,3),intpts(op,4),inttxt$(op))
end if
if refresh(1)=1 then
call draw_int
end if
loop
end sub
sub draw_int
let u=ubound(intpts,1)
clear
for i=1 to u
draw intbox(i)
next i
box keep 0,1,0,1 in intbox$
end sub
picture intbox(op)
draw box(intpts(op,1),intpts(op,2),intpts(op,3),intpts(op,4),op)
draw textbox(intpts(op,1),intpts(op,2),intpts(op,3),intpts(op,4),inttxt$(op))
end picture
sub getclick_int(op)
get mouse x,y,state
let op=-1
if state<>0 and x>=0 and x<=1 and y>=0 and y<=1 then
let u=ubound(intpts,1)
let op=0
for i=1 to u
if x>intpts(i,1) and x<intpts(i,2) and y>intpts(i,3) and y<intpts(i,4) then
let op=i
exit sub
end if
next i
end if
end sub
end module